package com.sc.nft.enums.task;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;


@AllArgsConstructor
@Getter
public enum TaskPrizeTypeEnum {

    INTEGRAL(1,"星球碎片"),
    PROPS(2,"虚拟道具"),

    ;
    @EnumValue
    private int code;
    private String description;

    // 根据code获取枚举
    public static TaskPrizeTypeEnum getByCode(int code) {
        for (TaskPrizeTypeEnum value : TaskPrizeTypeEnum.values()) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
